<div ng-include="sys_html('layout/_header')"></div>

<div class="ncm-container">
    <div ng-include="sys_html('layout/member/left-layout')"></div> 
    <div ng-if="pagedata.op!='post'" class="right-layout">
		 <div class="wrap">
				<div ng-include="sys_html('layout/member/tabmenu')"></div> 
				<div class='fui-content' >
					<div class='content-empty' ng-if="!pagedata.list || pagedata.list.length<1">
						<i class='icon icon-location'></i>
						<br/>您还没有任何收货地址
					</div>
				
				<div ng-repeat="address in pagedata.list" class="fui-list-group address-item" style='margin-top:0.5rem;'
					 data-addressid="{{address.id}}">
					<div  class="fui-list" >
						<div class="fui-list-inner">
							<div class="title"><span class='realname'>{{address.realname}}</span> <span class='mobile'>{{address.mobile}}</span></div>
							<div class="text">
								<span class='address'>{{address.province}}{{address.city}}{{address.area}} {{address.address}}</span>
							</div>
							<div class='bar' >
								<span class='pull-right'>
									<a href="javascript:;" ng-click="access_json('/member.address/post/id='+address.id)"  data-nocache="true">
										<i class='icon icon-edit2'></i> 编辑
									</a>
									&nbsp;&nbsp;
									<a href="javascript:;" ng-click="post({},'/member.address/del/id='+address.id)" data-toggle='delete' class='external'>
									<i class='icon icon-delete'></i> 删除
									</a>
								</span>

								<label class='radio-inline'>
									<input type="radio" name='setdefault' data-toggle='setdefault' ng-click="post({},'/member.address/set/id='+address.id)" class="fui-radio fui-radio-danger" ng-checked="address.isdefault==1" /> 设置默认
								</label>
							</div>
						</div>
					</div>
				</div>
				
			</div>
			<a  ng-click="access_json('/member.address/post/')"  class="btn  btn-danger-o btn-edit" ><i class="icon icon-add"></i> 新建地址</a>
		</div>
	</div>
<div class="right-layout" ng-if="pagedata.op=='post'">
		<div method='post'  class='form-ajax' style="margin:10px">
			<div ng-include="sys_html('layout/member/tabmenu')"></div> 
                    <input type='hidden' id='addressid' value="{{pagedata.address.id}}"/>
                    <div class='fui-cell-group'>
                        <div class='fui-cell'>
                            <div class='fui-cell-label'>收件人</div>
                            <div class='fui-cell-info'><input type="text" id='realname'  name='realname' ng-model="pagedata.address.realname" placeholder="收件人" class="fui-input"/></div>
                        </div>
                        <div class='fui-cell'>
                            <div class='fui-cell-label'>联系电话</div>
                            <div class='fui-cell-info'><input type="tel" id='mobile' name='mobile' ng-model="pagedata.address.mobile" placeholder="联系电话"  class="fui-input"/></div>
                        </div>

                        <div class="fui-cell">
										<div class="fui-cell-label ">所在城市</div>
							
										<div class="fui-cell-label">
											<select ng-model="pagedata.address.pcd.province" class="form-control tpl-province">
											<option value="" selected="selected">请选择省份</option>
											<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.address.pcd.province==value">{{value}}</option>
											</select>
										</div>
										<div class="fui-cell-label">
											<select ng-model="pagedata.address.pcd.city" class="form-control tpl-city">
											<option value="" selected="selected">请选择城市</option>
											<option ng-repeat="(value,data) in pagedata.province[pagedata.address.pcd.province]" value="{{value}}" ng-selected="pagedata.address.pcd.city==value">{{value}}</option>
											</select>
										</div>
										<div class="fui-cell-label">
											<select ng-model="pagedata.item.pcd.district" class="form-control tpl-district">
											<option value="" selected="selected">区县</option>
											<option ng-repeat="(value,data) in pagedata.province[pagedata.item.pcd.province][pagedata.item.pcd.city]" value="{{value}}" ng-selected="pagedata.item.pcd.district==value">{{value}}</option>
											</select>
										</div>
										<div class="fui-cell-label">
											<select ng-model="pagedata.item.pcd.street" class="form-control tpl-district">
											<option value="" selected="selected">街道</option>
											<option ng-repeat="value in pagedata.province[pagedata.item.pcd.province][pagedata.item.pcd.city][pagedata.item.pcd.district]" value="{{value}}" ng-selected="pagedata.item.pcd.street==value">{{value}}</option>
											</select>
										</div>
							
						</div>

                        <div class='fui-cell'>
                            <div class='fui-cell-label'>详细地址</div>
                            <div class='fui-cell-info'><input type="text" id='address' name='address' ng-model="pagedata.address.address" placeholder='街道，楼牌号等'  class="fui-input"/></div>
                        </div>
                    </div>

                    <a id="btn-submit" ng-click="post(pagedata.address,'save')" class='external btn btn-danger block'>保存地址</a>
		</div>
</div>
<div ng-include="sys_html('layout/_footer')"></div>
